#pragma once

#include "ECS.h"

namespace ECS
{
	class IComponentFactory
	{
	public: 
		virtual Component* create() = 0;
	};

	template <class TDef, class TComponent>
	class ComponentFactory : public IComponentFactory
	{
	public:
		TDef* definition;

		virtual Component* create() override
		{
			TComponent* component = new TComponent();
			component->initWithDef(definition);

			return component;
		}
	};

	class AsemblyBuilder
	{
	public:
		void init(Assembly* assembly);
	protected:
		std::vector<IComponentFactory*> _components;
	};
}
